<template>
<div class="container__">
    <div class="cell">
        <div @click="call" class="wx">客服电话：{{info.kefu_tel}}</div>
    </div>
    <div class="cell">
        <div class="qq">QQ群：{{info.qq}}</div>
        <div class="copy" @click="copy">复制</div>
    </div>
    <van-cell title="微信群" is-link @click="toEwm">
        <view><img class="erwei" src="/static/images/eweima.png" alt=""></view>
    </van-cell>
</div>
</template>

<script>
import {
    kefu
} from '@/api/my'
export default {
    data() {
        return {
            info: {},
        }
    },
    methods: {
        toEwm() {
            wx.navigateTo({
                url: '/pages/erweima/main?info=' + JSON.stringify(this.info)
            })
        },
        copy() {
            wx.setClipboardData({
                data: this.info.qq,
                success: function (res) {
                    console.log(res)
                }
            })
        },
        getlist() {
            kefu().then(res => {
                this.info = res.data
            }).catch(err => {

            })
        },
        call() {
            wx.makePhoneCall({
                phoneNumber: this.info.tel
            })
        }
    },
    onLoad() {
        this.getlist()
    }
}
</script>

<style lang="scss">
.container__ {
    background-color: #F4F5F5;
    min-height: 100vh;
    font-size: 16px;

    .van-cell {
        align-items: center;
        font-size: 16px;
        height: 55px;

        .erwei {
            width: 20px;
            height: 20px;
            vertical-align: baseline;
        }
    }

    .cell {
        height: 55px;
        box-sizing: border-box;
        border-bottom: 1px solid rgba(221, 221, 221, 1);
        padding: 0 15px;
        display: flex;
        justify-content: space-between;
        align-items: center;
        background-color: #fff;

        .wx {
            font-weight: 500;
            color: rgba(26, 132, 251, 1);
            font-size: 16px;
        }

        .qq {
            color: #666666;
        }

        .copy {
            width: 50px;
            height: 25px;
            background: rgba(255, 255, 255, 1);
            border: 1px solid rgba(221, 221, 221, 1);
            border-radius: 3px;
            color: #999999;
            text-align: center;
            line-height: 25px;
        }

        .icons {
            height: 100%;
            display: flex;
            align-items: center;
            justify-content: flex-start;
        }
    }
}
</style>
